package cn.fintecher.pangolin.service.business.web;

import cn.fintecher.pangolin.common.web.BaseController;
import cn.fintecher.pangolin.entity.elastic.CaseTransferLog;
import cn.fintecher.pangolin.service.business.service.CaseTransferLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Auther: xiaqun
 * @Description: 案件日志相关接口
 * @Date: 9:27 2019/9/25
 */

@RestController
@RequestMapping("/api/caseTransferLogController")
@Api(value = "案件日志相关接口", description = "案件日志相关接口")
public class CaseTransferLogController extends BaseController {
    @Autowired
    private CaseTransferLogService caseTransferLogService;

    /**
     * 查询流转记录
     */
    @ApiOperation(value = "查询流转记录", notes = "查询流转记录")
    @GetMapping("/getAllCaseTransferLog")
    public ResponseEntity<List<CaseTransferLog>> getAllCaseTransferLog(@RequestParam @ApiParam(value = "案件ID", required = true) String caseId) {
        log.info("REST request to get all case transfer log,{}", caseId);
        List<CaseTransferLog> list = caseTransferLogService.getAllCaseTransferLog(caseId);
        return ResponseEntity.ok().body(list);
    }
}
